package algo.math.evaluator.interfaces;

import java.util.List;
import java.util.Map;
import algo.math.evaluator.context.IComponentObject;

/**
 * Represent an arithmetic evaluator.
 */
public interface IArithmeticEvaluator {
	
	
	/**
	 * Sets the number base.
	 *
	 * @param base the new base
	 */
	public void setBase(String base);
	
	/**
	 * Execute an arithmetic evaluation.
	 *
	 * @param the expression to process
	 * @param the variable to be registered. Default null.
	 * @return the evaluation product
	 */
	public String eval(String expression, Map<String, Object> variables);
	
	/**
	 * Register component.
	 *
	 * @param Any IComponent object. Object must implement either IFunction or IOperator.
	 */
	public void registerComponent(IComponentObject o);
	
	/**
	 * Unregister component.
	 *
	 * @param Any IComponent object. Object must implement either IFunction or IOperator.
	 */
	public void unregisterComponent(IComponentObject o);
	
	/**
	 * Register component.
	 *
	 * @param The component id.
	 */
	public void registerComponent(String o);
	
	/**
	 * Unregister component.
	 *
	 * @param  The component id.
	 */
	public void unregisterComponent(String o);
	
	/**
	 * List of registered operators.
	 *
	 * @return List of registered operator (Add,Sub,Mul,Div,Mod,Max,Min by default)
	 */
	public List<String> registredOperators();
}
